package com.shushan.login.bean;

import com.android.net.bean.NetBaseBean;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * @ClassName: ChildBookBean
 * @Desciption: 小孩课本bean
 * @author: yichaohua
 * @date: 2018-08-10
 */
@DatabaseTable(tableName = "childbook_table")
public class ChildBookBean extends NetBaseBean {

    @DatabaseField(id = true)
    public int id;
    @DatabaseField
    public int grade_id;
    @DatabaseField
    public String grade_name;
    @DatabaseField
    public String semester;
    @DatabaseField
    public int subject_id;
    @DatabaseField
    public String subject_name;
    @DatabaseField
    public int press_id;
    @DatabaseField
    public String press_name;
    @DatabaseField
    public String cover;
    @DatabaseField
    public int outline_detail_id;
    @DatabaseField
    public String outline_name;


    @Override
    public void initByJson(JSONObject jsonObject) throws JSONException {
        id = jsonObject.optInt("id",0);
        grade_id = jsonObject.optInt("grade_id",0);
        grade_name = jsonObject.optString("grade_name","");
        semester = jsonObject.optString("semester","");
        subject_id = jsonObject.optInt("subject_id",0);
        subject_name = jsonObject.optString("subject_name","");
        press_id = jsonObject.optInt("press_id",0);
        press_name = jsonObject.optString("press_name","");
        cover = jsonObject.optString("cover","");
        outline_detail_id = jsonObject.optInt("outline_detail_id",0);
        outline_name = jsonObject.optString("outline_name","");
    }
}
